/*
 * Copyright (c) 2025 CAX Conversion Project
 */
package com.comac.ins.cax.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.comac.ins.cax.domain.bo.CaxConvertInfoBo;
import com.comac.ins.cax.domain.bo.CaxFileInfoBo;
import com.comac.ins.cax.domain.bo.CaxSysLogBo;
import com.comac.ins.cax.domain.vo.CaxConvertInfoVo;
import com.comac.ins.cax.domain.vo.CaxSysLogVo;
import com.comac.ins.cax.service.ICaxSysLogService;
import com.comac.ins.common.json.utils.JsonUtils;
import com.comac.ins.common.mybatis.core.page.TableDataInfo;
import com.comac.ins.common.web.core.BaseController;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * cax系统日志
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/cax/sysLog")
public class CaxSysOperLogController extends BaseController {
    @Autowired
    private ICaxSysLogService iCaxSysLogService;

    /**
     * 系统日志列表查询
     *
     * @param bo 查询BO
     * @return TableDataInfo
     */
    @PostMapping("/list")
    @SaCheckPermission("cax:sysLog:list")
    public TableDataInfo<CaxSysLogVo> list(@RequestBody CaxSysLogBo bo) {
        return iCaxSysLogService.selectList(bo);
    }

    /**
     * 系统日志导出
     * @param response
     * @return
     */
    @PostMapping("/exportData")
    @SaCheckPermission("cax:sysLog:exportData")
    public void exportData(HttpServletResponse response,CaxSysLogBo bo) {
        iCaxSysLogService.export(response,bo);
    }
}
